login/logout tests a little less fake

jamesperet 9 years ago
parent
commit
c87346c654
2 changed files with 3 additions and 4 deletions
  1. 1 3
      features/step_definitions/login_steps.rb
  2. 2 1
      features/user_account.feature

+ 1 - 3
features/step_definitions/login_steps.rb

@@ -52,9 +52,7 @@ Then(/^I log in with the email "(.*?)" and password "(.*?)"$/) do |arg1, arg2|
52 52
   fill_in "user_email", :with => arg1
53 53
   fill_in "user_password", :with => arg2
54 54
   click_button "Submit"
55
-  user = User.find_by_email(arg1)
56
-  login_as user, scope: :user
57
-  visit root_path
55
+  page.driver.submit :post, new_user_session_path(:user => {email: arg1, password: arg2}), {}
58 56
 end
59 57
 
60 58
 # METHODS

+ 2 - 1
features/user_account.feature

@@ -13,7 +13,8 @@ Feature: User Account
13 13
 		When I go to the login page
14 14
 		Then I should see "Sign In"
15 15
 		And I log in with the email "monty_cantsin@canada.com" and password "12345678"
16
-		Then I should see "Monty Cantsin"
16
+		Then I should see "Signed in successfully"
17
+		And I should see "Monty Cantsin"
17 18
 		And I should see "Logout"
18 19
 		
19 20
 	Scenario: Registered user logout